import { Column, Entity } from "typeorm";
import { BaseEntity } from "../../base/entity/base";

@Entity('provider_team', { comment: '服务人员团队，新增租户的时候会根据新增的服务人员ID自动创建一个团队，这个时候，团队成员就只有他自己，租户的商户信息会关联到这个团队' })
export class ProviderTeamEntity extends BaseEntity {

    @Column({ comment: '团队名称', length: 255, nullable: false })
    name: string;

    @Column({ comment: '团队介绍', length: 500, nullable: true })
    introduction: string;

    @Column({ comment: '团队所有者ID', nullable: false, unique: true })
    ownerProviderId: number

    @Column({ comment: '是否为租户', default: false })
    isTenant: boolean = false

    @Column({ comment: '团队邀请码', length: 255, unique: true })
    inviteCode: string;

}